package com.dao;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import com.dao.base.BaseRepository;
import com.dao.entity.Commissioner;


/**
 * @author geliyang
 *
 */
@Repository
public interface ICommissionerDao extends BaseRepository<Commissioner,Long>{

    /**
     * 登录查询
     * @param username
     * @param password
     * @return
     */
    public Commissioner findByAccountAndPasswordAndIsApproval(String account, String password, Integer IsApproval);
    
    /**
     * 名字查询分页
     * @param username
     * @param pageable
     * @return
     */
    public Page<Commissioner> findByUserName(String username, Pageable pageable);
    
    /**
     * 名字模糊查询分页
     * @param username
     * @param pageable
     * @return
     */
    public Page<Commissioner> findAllByUserNameLike(String username, Pageable pageable);

	public Commissioner findByAccount(String account);

	public Commissioner findByAccountAndRole(String account, Integer role);

	public Commissioner findByAccountAndPasswordAndRole(String account, String password, Integer role);

	public Commissioner findByOpenIdAndRole(String openId, Integer role);
	
	public Commissioner findByIdAndIsApproval(Long id, Integer isApproval);

}
